const BannerModel = require("./models/BannerModel");

// 获取标语
exports.getAllBanner = async function () {
    const data = await BannerModel.findAll();
    return JSON.parse(JSON.stringify(data));
}

//修改标语
exports.updateBanner = async function (updateInfo) {
    console.log(updateInfo)

    await BannerModel.destroy({
        truncate: true,//删除所有数据
    })
    console.log(updateInfo)
    const data = await BannerModel.bulkCreate(updateInfo);
    console.log(data, "data")
    return JSON.parse(JSON.stringify(data));
}